package com.runa.persistence.service;

import com.runa.monitor.comm.entity.CommMeter;
import com.runa.monitor.comm.entity.CommValve;
import com.runa.persistence.repository.CommValveRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * 2024/6/25 14:30
 * zhangYB
 */
@Service
public class CommValveService extends BatchService {

    @Resource
    private CommValveRepository commValveRepository;

    public List<CommValve> getAllByIds(List<String> ids) {
        List<CommValve> commValves = new ArrayList<>();
        List<List<String>> subIdsList = getSubIdsList(ids);
        for (List<String> subIds : subIdsList) {
            List<CommValve> subCommValves = commValveRepository.getAllByIds(subIds);
            commValves.addAll(subCommValves);
        }
        return commValves;
    }

}
